import Vue from "vue";
//引入vue
import VueRouter from "vue-router";
//引入vue路由
import Home from "../views/Home.vue";
//引入home.vue
// import My from "../views/My.vue";

Vue.use(VueRouter);
//vue使用路由

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
  },
  {
    path: "/about",
    name: "About",
    component: () => import("../views/About.vue"),
  },
  {
    path: "/my",
    name: "My",
    component: () => import("../views/My.vue"),
  },
];
//这个数组就是我们说的路由规则 规定在什么路径加载什么组件

const router = new VueRouter({
  routes,
});

export default router;
